package com.tencent.smtt.sdk;

import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import com.tencent.smtt.sdk.QbSdk;
import com.tencent.smtt.utils.TbsLog;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes2.dex */
public final class j extends Handler {
    final /* synthetic */ QbSdk.PreInitCallback a;
    final /* synthetic */ Context b;

    /* JADX INFO: Access modifiers changed from: package-private */
    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public j(Looper looper, QbSdk.PreInitCallback preInitCallback, Context context) {
        super(looper);
        this.a = preInitCallback;
        this.b = context;
    }

    @Override // android.os.Handler
    public void handleMessage(Message message) {
        bu c;
        boolean z;
        QbSdk.PreInitCallback preInitCallback;
        int i = message.what;
        if (i == 1) {
            if (TbsConfig.APP_WX.equals(QbSdk.getCurrentProcessName(this.b))) {
                z = QbSdk.A;
                if (!z) {
                    QbSdk.j = false;
                }
            }
            if (QbSdk.j && (c = bt.a().c()) != null) {
                c.a(this.b);
            }
            QbSdk.PreInitCallback preInitCallback2 = this.a;
            if (preInitCallback2 != null) {
                preInitCallback2.onViewInitFinished(true);
            }
        } else if (i != 2) {
            if (i == 3 && (preInitCallback = this.a) != null) {
                preInitCallback.onCoreInitFinished();
                return;
            }
            return;
        } else {
            QbSdk.PreInitCallback preInitCallback3 = this.a;
            if (preInitCallback3 != null) {
                preInitCallback3.onViewInitFinished(false);
            }
        }
        TbsLog.writeLogToDisk();
    }
}
